const mysql = require("../mysql");
function response(options) {
    return new Promise(async resolve => {
        try {
            console.log(options)
            let sql = `update qq_account set cookie = '${options.cookie}', is_login = 1,is_failed = 0 where id = ${options.id};`
            console.log(sql)
            mysql(sql, function (error, results, fields) {
                if (error)throw error;
                console.log('查询成功');
                resolve(results);
            });
        } catch (e) {
            logger.error(e.message)
            resolve({ result: "failure ", errorMsg: e.message, status: (e.response || {}).status })
        }
    })
}
module.exports = async options =>{
    let res = await response(options);
    return res;
}